package com.practice.backend.Repository;


import com.practice.backend.Entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public interface UserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {

    List<User> findByUsernameContaining(String username);

    User findByUsername(String username);


    Page<User> findBySex(String sex, Pageable pageable);

    User findByPhone(String phone);
}